#include<iostream>
#include<string>
#include<cmath>
using namespace std;

int main(){
    int number=100;
    int sum=0;
    int flag=0;
    string s;
    while(number<=999){
        sum=0;
        s=to_string(number);
        int length=s.size();
        for(int i=0;i<length;i++){
            sum+=pow((s[i]-'0'),3);
        }
        if(sum==number)
        cout<<number<<"\n";
        number++;
    }



}
